Skip to content

drm/msm: sc8180x: restore dp_phy_intf_sel and DP AUX state on s2idle resume - #202

Open
robertijtsma wants to merge 2 commits into
linux-surface:spx/v7.3from
robertijtsma:spx-drm-msm-s2idle-resume
Open

robertijtsma wants to merge 2 commits into
linux-surface:spx/v7.3from
robertijtsma:spx-drm-msm-s2idle-resume

Conversation

@robertijtsma

Copy link
Copy Markdown

Fixes blank eDP/DP display after s2idle suspend/resume on SC8180X / Surface Pro X via two atomic commits:

  1. drm/msm/dpu: sc8180x: restore dp_phy_intf_sel on runtime resume: extracts dpu_kms_setup_dp_phy_intf_sel() and invokes it from both dpu_kms_hw_init() and dpu_runtime_resume() so DPU_MDP_DP_PHY_INTF_SEL is restored after MDSS power collapse.
  2. drm/msm/dp: restore AUX reftimer and check xfer state for external HPD: clears REG_DP_AUX_TRANS_CTRL before DP_AUX_CTRL_RESET, ensures DP_DP_HPD_REFTIMER_ENABLE is set in msm_dp_aux_enable() when internal HPD is unused, and falls back to aux->enable_xfers in msm_dp_aux_is_link_connected() when DP_DP_HPD_CTRL_HPD_EN is clear (eDP / external HPD bridges).

Verification

On SC8180X, DPU_MDP_DP_PHY_INTF_SEL is currently programmed only once
during dpu_kms_hw_init(). When MDSS/DPU loses register state across
runtime suspend or s2idle suspend/resume, the DP <-> PHY interface
selection is not restored, leaving eDP/DP output misrouted after resume.

Extract dpu_kms_setup_dp_phy_intf_sel() and call it from both
dpu_kms_hw_init() and dpu_runtime_resume().

Tested on Microsoft Surface Pro X SQ2 (SC8180X) across s2idle suspend
and resume.

Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
On SC8180X / Surface Pro X, eDP and external HPD-bridge DP controllers
leave internal HPD_CTRL disabled. Across runtime suspend or s2idle
suspend/resume, three AUX issues prevent reliable link re-training:

1. msm_dp_aux_reset() does not clear REG_DP_AUX_TRANS_CTRL before
   pulsing DP_AUX_CTRL_RESET, which can leave a stale transaction bit
   latched on reset.
2. msm_dp_aux_enable() relies on internal HPD setup to enable the 1us
   REG_DP_DP_HPD_REFTIMER; when internal HPD is disabled, AUX timeouts
   stall after power collapse unless DP_DP_HPD_REFTIMER_ENABLE is set.
3. msm_dp_aux_is_link_connected() reads REG_DP_DP_HPD_INT_STATUS even
   when DP_DP_HPD_CTRL_HPD_EN is clear, returning 0 and skipping AUX
   reset on transfer error for external HPD bridges.

Clear REG_DP_AUX_TRANS_CTRL in msm_dp_aux_reset(), ensure
DP_DP_HPD_REFTIMER_ENABLE is set in msm_dp_aux_enable(), and fall back
to aux->enable_xfers when internal HPD_CTRL is disabled.

Tested on Microsoft Surface Pro X SQ2 (SC8180X) across s2idle suspend
and resume.

Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant